home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / TCTOS.H < prev    next >
Text File  |  1988-05-30  |  777b  |  22 lines

  1. /* -*-C-*- tctos.h */
  2. /*-->tctos*/
  3. /**********************************************************************/
  4. /****************************  tctos  *********************************/
  5. /**********************************************************************/
  6.  
  7. char *
  8. tctos()    /* return pointer to (static) TeX page counter string */
  9. {    /* (trailing zero counters are not printed) */
  10.     register INT16 k;    /* loop index */
  11.     register INT16 n;    /* number of counters to print */
  12.     static char s[111];    /* 10 32-bit counters n.n.n... */
  13.  
  14.     for (n = 9; (n > 0) && (tex_counter[n] == 0); --n)
  15.     /* NO-OP */;
  16.     s[0] = '\0';
  17.     for (k = 0; k <= n; ++k)
  18.     (void)sprintf(strrchr(s,'\0'),"%ld%s",
  19.         tex_counter[k],(k < n) ? "." : "");
  20.     return ((char *)&s[0]);
  21. }
  22.